import { BeforeApplicationShutdown, Controller, Get, OnApplicationBootstrap, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController implements
  OnModuleInit,
  OnApplicationBootstrap,
  OnModuleDestroy,
  BeforeApplicationShutdown {
  constructor(private readonly appService: AppService) { }

  onModuleInit() {
    console.log("controller初始化");
  }
  onApplicationBootstrap() {
    console.log("controller初始化完成");
  }
  onModuleDestroy() {
    console.log("controller销毁");
  }

  beforeApplicationShutdown() {
    console.log("controller关闭");
  }

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }
}
